package Math.两道算法水题;

public class 判断一个数是否是质数 {

    public static void main(String[] args) {
        System.out.println(isPrime(7));
    }
    public static boolean isPrime(int number){
        for (int i = 2; i < Math.sqrt(number); i++) {
            if(number%i==0){
                return false;
            }
        }
        return true;
    }
}
